Skip to content

fix(server): memoize facade action wrapping and refine export classification - #1211

Open
vivek7405 wants to merge 1 commit into
mainfrom
fix/action-seed-export-classification
Open

fix(server): memoize facade action wrapping and refine export classification#1211
vivek7405 wants to merge 1 commit into
mainfrom
fix/action-seed-export-classification

Conversation

@vivek7405

Copy link
Copy Markdown
Collaborator

Closes #1208

Follow-up to #1209 addressing feedback from the PR review:

  1. Memoize facade function wrapping: Emits module-level let _fn_<NAME>; variables inside generated facades so __w() lookups and Proxy instantiations occur once on first invocation per action function rather than on every call.
  2. Refine export classification: Scans local non-function variable statements (including multi-variable const a = 1, b = 2; declarations) so non-function values exported via export { ... } list syntax are classified into valNames rather than fnNames.
  3. Clean up unused test import: Removed unreferenced installBunSeedPlugin import in test/bun/action-seed-circular.test.mjs.

Verification

  • Unit test suite node --test packages/server/test/seed/action-seed-unit.test.js: 19/19 pass (including new memoization & export classification tests).
  • Integration test suite node --test packages/server/test/seed/seed-hook.test.js: 5/5 pass.
  • Bun parity test bun test test/bun/action-seed-circular.test.mjs: 1/1 pass.
  • Action seed tests via node --test packages/server/test/seed/*.test.js: 24/24 pass.

…ication

Refine export symbol classification in extractExportNames() to properly recognize non-function variables declared locally in export lists (export { a, b }).

Memoize action function resolution in generated buildFacade() via module-scoped variables (_fn_<NAME>), avoiding redundant __w() lookups and Proxy instantiations on repeated calls.

Remove unused import in Bun circular re-export test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Circular re-export between two use-server modules crashes at load

1 participant